package chamber.one.guice;

import chamber.one.thread.HasThreePredicate;
import chamber.one.thread.ToDividedByThreeSumAsyncFunction;
import chamber.one.thread.ToDividedByThreeSumFunction;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.inject.AbstractModule;

import java.util.concurrent.Executors;

/**
 * Created by Gerardo on 12/7/13.
 */
public class ChamberOneModule extends AbstractModule {
    @Override
    protected void configure() {
        bind(HasThreePredicate.class);
        bind(ToDividedByThreeSumFunction.class);
        bind(ToDividedByThreeSumAsyncFunction.class);
        bind(ListeningExecutorService.class).toInstance(MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(10)));
    }
}
